<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0">
    <meta http-equiv="expires" content="0">
    <meta http-equiv="pragma" content="no-cache">
    <META http-equiv="cache-Control" content="no-cache,no-store, must-revalidate">  
    <title>玩AR游戏 赢虎扑好礼</title>
    <link rel="stylesheet" type="text/css" media="screen" href="{$staticHost}/static/css/base.css?v=10" />
    <link rel="stylesheet" type="text/css" media="screen" href="{$staticHost}/static/css/run.css?v=130" />
    <script src="{$staticHost}/static/js/jquery.min.js"></script>
    <script src="{$staticHost}/static/js/js.js"></script>
    <script src="{$staticHost}/static/js/jquery.cityselect.js"></script>
</head>
<body class="share-box">
  <div id="tips"></div>
<section class="share-bg">

  <img class="user-img" src="{$winningInfo['header']}">
  <!-- 得奖用户头像 -->
  <img style="width: 100%" src="{$staticHost}/static/images/img/img01.png">
  <h2 class="prizeName ac f24 color-yellow">$winningInfo['prizeName']</h2>
  <p class="f18 color-white ac m10">填写您的收货地址让扑妞为您送货吧</p>
  <!-- 得奖用户名称 -->
  <form class="form-horizontal"  action="/paome_share/shareWinning?prize={$winningInfo[prize]}"  id="tr_form" enctype="multipart/form-data" onsubmit="return false;">
    <ul class="address-list">
      <li>
        <span>姓名</span>
        <input id="name" type="" name="realname" value="$winningInfo['realname']">
      </li>
       <li>
        <span>电话</span>
        <input id="phone" type="" name="phone" value="$winningInfo['phone']">
      </li>
      <li>
        <span>地址</span>
        <div id="city">
          <select class="prov" name="provice" value="$winningInfo['provice']"></select>
          <select class="city" disabled="disabled" name="city" value="$winningInfo['city']"></select>
        </div>
      </li>
      <li>
        <span></span>
        <input id="address" type="" name="address" placeholder="输入详细地址" value="$winningInfo['address']">
      </li>
    </ul>
    <a id="submit" style="width: 50%" class="yellow-btn">提交</a>
  </form>
</section>
<script type="text/javascript">
  $("#city").citySelect({
      url:"{$staticHost}/static/js/city.min.js",
      prov:"上海", 
      city:"虹口区", 
      nodata:"none" 
  });
  // 城市二级联动
    $('#submit').on('click',function(){
     
      var name = $("#name").val();
      var address = $("#address").val();
      if(!name||!address){
        $("#tips").show();
        $("#tips").html("信息填写不完整");
        Timeout();
        return
      }
      var mobileReg = /^(17[0-9]|13[0-9]|15[0-9]|18[0-9]|14[57])[0-9]{8,8}$/;
      var phone = $.trim($('#phone').val());
      if(phone.length != 11 || !mobileReg.test(phone)) {
        $("#tips").show();
        $("#tips").html('手机号码输入有误！请重新输入！');
        Timeout();
        return;
      }
      $.ajax({
        type:'POST',
        url:$('#tr_form').attr('action'),
        data: new FormData($('#tr_form')[0]),
        processData: false,
        contentType: false,
        dataType:'json',
        success:function(data,error){
          console.log(data)
          if(data.status.code==200&& data.result.wid){
            window.location.href="sharePao?target_uid="+{$target_uid}
          }else{
            $("#tips").show();
            $("#tips").css("top","20%");
            $("#tips").html(data.error.text);
            Timeout();
          }
        }

      })

  })
function Timeout(){
  // screenHeight = document.body.scrollHeight
  //  var ee=screenHeight/2;
  $("body").css("overflow","hidden")
  // $("#tips").css("top",ee+"px")
  setTimeout(function(){ 
   $("#tips").hide();
   $("body").css("overflow","auto")
  }, 2000);
}
</script>
</body>
{template 'show/web-footer'}
